﻿<div class="public_width search">
	<dl>
		<dt>热门关键词:
		<?php
		$keywords = App::getHelper('tag')->getHotKeyword(10);
		foreach ($keywords as $keyword):
		?>
		<a href="<?php echo $this->getUrl(array('tag' => $keyword->getName()), 'index', 'result', 'search') ?>"> <?php echo $keyword->getName() ?></a>
		<?php endforeach; ?>
		</dt>
		<dd>
			<form id="search_form" method="get" action="<?php echo $this->getUrl(NULL, 'index', 'result', 'search') ?>">
				<input id="tagword" type="text" name="tag" onfocus="if(this.value=='请输入关键字'){this.value=''}" onblur="if(this.value==''){this.value='请输入关键字'}" value="<?php echo trim(Kd_Web::getRequest()->getParameter('tag', '请输入关键字')) ?>" />
				<button type="submit">搜索</button>
			</form>
		</dd>
	</dl>
</div>
<script language="javascript" type="text/javascript">
$('#search_form').submit(function(){
    if($.trim($('#tagword').val()).length == 0 || $.trim($('#tagword').val()) == '请输入关键字'){
        $('#tagword').focus();
        return false;
    }
})
</script>